<script setup lang="ts">
import { storeToRefs } from 'pinia';

import { guanlianprdStore, link1688stor } from '#/store';

// import { errimage } from '#/utils';

const props = defineProps<{
  record?: any;
}>();

const guanlianprd = guanlianprdStore();
const { showaddimgstatus } = storeToRefs(guanlianprd);
const link1688 = link1688stor();
function openUseLinkBox() {
  link1688.getDeteail(props.record);
  link1688.showIsLinkBindStatus = true;
}
function openshowAddUseImage() {
  // guanlianprd.$reset();
  guanlianprd.setShopData({
    shopName: props.record.shopName,
    shopId: props.record.shopId,
  });
  guanlianprd.setSelectGetImageItemsData([props.record]);
  showaddimgstatus.value = true;
}
</script>

<template>
  <div>
    <a-empty
      :image-style="{
        height: '60px',
        display: 'flex',
        justifyContent: 'center',
      }"
      image="https://gw.alipayobjects.com/mdn/miniapp_social/afts/img/A*pevERLJC9v0AAAAAAAAAAABjAQAAAQ/original"
    >
      <template #description>
        <span> 没有关联货源，请先关联货源 </span>
      </template>
      <a-space>
        <a-button type="primary" @click="openUseLinkBox"> 链接关联 </a-button>
        <a-button type="primary" @click="openshowAddUseImage">
          同款推荐
        </a-button>
      </a-space>
    </a-empty>
  </div>
</template>
